package com.example.back.dao.topup;

import com.example.back.bean.topup.TopUpInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TopUpDao {

    @Select("select * from top_up_config")
    List<TopUpInfo> getTopUpConfig();

    @Update("update top_up_config set money=#{money}, diamonds=#{diamonds}, extra=#{extra} where id=#{id}")
    int updateTopUp(int id, int money, int diamonds, int extra);

    @Insert("insert into top_up_config (money,diamonds,extra)values(#{money},#{diamonds},#{extra})")
    int insertTopUp(int money,int diamonds,int extra);

    @Delete("delete from top_up_config where id = #{id}")
    int deleteTopUpInfo(int id);

    @Select("select msgValue from t_resources_configs where msgType = 'ServerConfig' and msgKey = 'ios' ")
    String selectIosConfig();

    @Select("select msgValue from t_resources_configs where msgType = 'ServerConfig' and msgKey = 'ads' ")
    String selectCgRewardConfig();

    @Update("update  t_resources_configs set msgValue =#{value} where msgType = 'ServerConfig' and msgKey = 'ios' ")
    boolean UpdateIosConfig(String value);

    @Update("update  t_resources_configs set msgValue =#{value} where msgType = 'ServerConfig' and msgKey = 'ads' ")
    boolean UpdateCgRewardConfig(String value);


}
